package net.message {

	import flash.utils.IDataInput;
	import net.MessageType;
	import net.handler.GC_Loading_EquipHandler;
	import util.Long;
	
	/**
	 * 文件名：GC_Loading_EquipMessage.as
	 * <p>
	 * 功能：读取装备列表
	 * <p>
	 * 版本：1.0.0
	 * <p>
	 * 作者：Builderd by AppTools
	 * <p>
	 */
	public class GC_Loading_EquipMessage extends BaseMessage {
	
		//写入装备key-主键
		public var equipId:Long;
		//写入英雄key-外键
		public var heroId:Long;
		//写入装备模板code
		public var equipCode:Long;
		//写入级别
		public var lv:int;


		public function GC_Loading_EquipMessage() {
			super();
			type = MessageType.GC_Loading_Equip;
			handler = new GC_Loading_EquipHandler();
		}
	
		override public function readMessage(data:IDataInput):void {
			//写入list长度
			var size:int = data.readByte();
			//循环写入数据
			for(var i:int=0;i<size;i++) {
			
				var itemInfo:ItemInfo = new ItemInfo();
				
				//写入装备key-主键
				itemInfo.equipId = data.readLong();
				//写入英雄key-外键
				itemInfo.heroId = data.readLong();
				//写入装备模板code
				itemInfo.equipCode = data.readLong();
				//写入级别
				itemInfo.lv = data.readInt();
				
				dataProvider.push(heroInfo);
			}
	
		}
	}
}
